package com.example.book.controller;

import com.example.book.service.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class UploadController {

    @Autowired
    OssService ossService;


    @RequestMapping("upload")
    public String  upload(MultipartFile file){
        String path = ossService.uploadOss(file);
        System.out.println("执行成功");
        return  path;
    }
}
